package cn.wx.jove.core.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.wx.common.persistence.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import cn.wx.jove.core.service.PlateService;
import cn.wx.jove.core.entity.Plate;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.jove.core.entity.qo.PlateQ;
/**
 *   @description : Plate 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-11-30
 */
@RestController
@RequestMapping("/plate")
public class PlateController extends BaseController {

    @Autowired
    private PlateService plateService;

    /**
     * @description : 通过条件获取Plate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/query/unique", method = RequestMethod.POST)
    public ResponseData queryUnique(PlateQ plateQ) throws Exception {
        return success(plateService.queryUnique(plateQ,Plate.class));
    }

    /**
     * @description : 通过条件获取Plate分页
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/query/page", method = RequestMethod.POST)
    public ResponseData queryPage(PlateQ plateQ) throws Exception {
        return success(plateService.queryPage(plateQ));
    }

	/**
     * @description : 通过条件获取Plate
     * ---------------------------------
     * @author : 
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/query/list", method = RequestMethod.POST)
    public ResponseData queryList(PlateQ plateQ) throws Exception {
        return success(plateService.queryList(plateQ));
    }
    
    /**
     * @description : 通过id删除Plate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    public ResponseData remove(Plate plate) throws Exception {
        return success(plateService.remove(plate));
    }

    /**
     * @description : 通过id更新Plate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    public ResponseData modify(Plate plate) throws Exception {
        return success(plateService.modify(plate));
    }
    
    /**
     * @description : 新增Plate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
     @RequestMapping(value = "/create", method = RequestMethod.POST)
     public ResponseData create(Plate plate) throws Exception {
        return success(plateService.create(plate));
     }
}